package common;


import javax.swing.JOptionPane;

import GUI.MainGUI;
import GUI.ServerGUI;

/**
 * @author Omri Barda		039725890 
 * @author Amit Joseph		034608547
 * @author Gilad Shpigel  	300162393
 * @author Elad elbaz		040539959
 * @version May 2012
 */

/**
 * Show error message.
 * 
 * @param String
 *            of error message.
 */
public class Perror {
	/**
	 * the method displays Error messages on the screen
	 * 
	 * @param error_message
	 *            the error message
	 */
	public static void pError(String error_message) {
		JOptionPane.showMessageDialog(MainGUI.mainframe, "Error: "
				+ error_message,"Error",JOptionPane.ERROR_MESSAGE);
	}
	/**
	 * the method displays Fatal Error messages on the screen
	 * 
	 * @param error_message
	 *            the error message
	 */
	public static void pFatalError(String error_message) {
		JOptionPane.showMessageDialog(MainGUI.mainframe, "Error: "
				+ error_message,"Error",JOptionPane.ERROR_MESSAGE);
		System.exit(0);
	}
	
	public static void sError(String error_message) {
		JOptionPane.showMessageDialog(ServerGUI.mainframe, "Error: "
				+ error_message,"Error",JOptionPane.ERROR_MESSAGE);
		
	}
	
	public static void sFatalError(String error_message) {
		JOptionPane.showMessageDialog(ServerGUI.mainframe, "Error: "
				+ error_message,"Error",JOptionPane.ERROR_MESSAGE);
		System.exit(0);
		
	}

}
